
local GuideUtil = require("src.app.test.GuideUtil")



local MainScene = class("MainScene", function()
    return display.newScene("MainScene")
end)

function MainScene:ctor()
    local LayerColor = cc.LayerColor:create(cc.c4b(255,0,0,155))
    self:addChild( LayerColor ) 
    local stencil = display.newSprite("unlock_advanced.png")--clippingNode 的模板 
    stencil:addTo(LayerColor)
    stencil:setName("stencil")


    self.label = cc.ui.UILabel.new({
            UILabelType = 2, text = "Hello, lable1", size = 64})
        :align(display.CENTER, display.cx, display.cy)
        :addTo(self)
    self.label:scale(0.5)
    local label = self.label  
    label:setTouchEnabled(true)
    label:setTouchMode(cc.TOUCH_MODE_ONE_BY_ONE)
    label:addNodeEventListener(cc.NODE_TOUCH_EVENT, function(event)
        if event.name == "began" then
            return true
        elseif event.name == "ended" then
            print('111111')
        end
    end)
    label:setName("label1")
    self.label = cc.ui.UILabel.new({
        UILabelType = 2, text = "Hello, lable2", size = 64})
        :align(display.CENTER, display.cx+100, display.cy+100)
        :addTo(self)
    self.label:scale(0.5)
    local label = self.label  
    label:setTouchEnabled(true)
    label:setTouchMode(cc.TOUCH_MODE_ONE_BY_ONE)
    label:addNodeEventListener(cc.NODE_TOUCH_EVENT, function(event)
        if event.name == "began" then
            return true
        elseif event.name == "ended" then
            print('labelTouched')
        end
    end)
    label:setName("label2")
   
   
    
  
        
end

function MainScene:onEnter()
    local guideUtil = GuideUtil.new()
    guideUtil:show_guide_view(GetChildByName(self,"label2"),function()
        print("func")
    end)
    

end

function MainScene:onExit()
end

return MainScene
